package com.zyht.bank.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zyht.bank.dao.AxdCustLoanMapper;
import com.zyht.bank.dao.AxdCustLoanSQLMapper;
import com.zyht.bank.dao.AxdCustLoanTagsSQLMapper;
import com.zyht.bank.entity.AxdCustLoan;
import com.zyht.bank.entity.AxdCustLoanExample;
import com.zyht.bank.entity.AxdCustloanInfo;
import com.zyht.bank.manage.vo.AxdCertificateInfoVo;
import com.zyht.bank.manage.vo.AxdCustLoanDetail;
import com.zyht.bank.manage.vo.AxdCustLoanVo;
import com.zyht.bank.manage.vo.CertificateInfoVo;
import com.zyht.bank.manage.vo.LoanCheckResultVo;
import com.zyht.bank.manage.vo.LoanCondition;
import com.zyht.bank.manage.vo.WxFlagVo;
import com.zyht.bank.manage.vo.WxTagVo;
import com.zyht.bank.service.AxdCustLoanService;
import com.zyht.common.BaseDao;
import com.zyht.common.BaseServiceImpl;

@Service("axdCustLoanService")
public class AxdCustLoanServiceImpl extends BaseServiceImpl<AxdCustLoan, AxdCustLoanExample> implements AxdCustLoanService {

	@Resource
	private AxdCustLoanMapper axdCustLoanMapper;
	
	@Resource
	private AxdCustLoanSQLMapper axdCustLoanSQLMapper;
	
	@Resource
	private AxdCustLoanTagsSQLMapper axdCustLoanTagsSQLMapper;
	@Override
	public BaseDao<AxdCustLoan, AxdCustLoanExample> dao(){

		return axdCustLoanMapper;
	}

	@Override
	public void doBatchDelete(List<Integer> ids) {
		this.axdCustLoanSQLMapper.doBatchDelete(ids);
	}

	@Override
	public void doBatchAdd(List<AxdCustLoan> list) {
		this.axdCustLoanSQLMapper.doBatchAdd(list);
	}

	@Override
	public List<AxdCertificateInfoVo> selectCertificateInfos(String custIdNum) {
		return this.axdCustLoanSQLMapper.selectCertificateInfos(custIdNum);
	}

	@Override
	public List<AxdCustLoanVo> getAxdCustLoanVos(AxdCustLoanVo bean) {
		return this.axdCustLoanSQLMapper.getAxdCustLoanVos(bean);
	}

	@Override
	public Integer count(AxdCustLoanVo bean) {
		return this.axdCustLoanSQLMapper.count(bean);
	}

	@Override
	public AxdCustLoanDetail getAxdCustLoanDetail(Integer id) {
		return this.axdCustLoanSQLMapper.getAxdCustLoanDetail(id);
	}

	@Override
	public List<CertificateInfoVo> selectCertificateImages(String custLoanId) {
		return this.axdCustLoanSQLMapper.selectCertificateImages(custLoanId);
	}

	@Override
	public void doBatchAdd2(List<AxdCustLoan> list, List<AxdCustloanInfo> list2,List<AxdCustLoan> custLoanUpdate,List<AxdCustloanInfo> custloanInfoUpdate) {
		if(list.size()>0){
			this.axdCustLoanSQLMapper.doBatchCustLoan(list);
			this.axdCustLoanSQLMapper.doBatchCustLoanInfo(list2);
		}
		if(custLoanUpdate.size()>0){
			this.axdCustLoanSQLMapper.doUpdateLoan(custLoanUpdate);
			this.axdCustLoanSQLMapper.doUpdateLoanInfo(custloanInfoUpdate);
		}
	}

	@Override
	public void doBatchUpdate(List<LoanCheckResultVo> list,List<LoanCondition> loanConList) {
		this.axdCustLoanSQLMapper.doBatchUpdate(list);
		if(null!=loanConList){
			this.axdCustLoanSQLMapper.doBatchLoanResult(loanConList);
		}
	}

	@Override
	public List<AxdCustLoanDetail> getAxdCustLoanList(AxdCustLoanVo bean) {
		return this.axdCustLoanSQLMapper.getAxdCustLoanList(bean);
	}

	@Override
	public List<WxTagVo> getWxTags() {
		return this.axdCustLoanSQLMapper.getWxTags();
	}

	@Override
	public List<WxFlagVo> getWxFlag(List<Integer> list) {
		return this.axdCustLoanSQLMapper.getWxFlag(list);
	}

	@Override
	public void doBatchUpDateFlag(List<WxFlagVo> list) {
		this.axdCustLoanSQLMapper.doBatchUpDateFlag(list);
	}

	@Override
	public List<AxdCustLoan> findTags(String tagId) {
		// TODO Auto-generated method stub
		return this.axdCustLoanTagsSQLMapper.findTags(tagId) ;
	}

}
